package com.gxa.luckin.core.pojo;

import com.gxa.luckin.core.groups.AddShopGroup;
import com.gxa.luckin.core.groups.UpdateShopGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.sql.Time;

/**
 * @author: fanyouzhao
 * @date: 11:35 2021/7/16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "tb_shop")
@ApiModel("门店的实体类型")
public class Shop implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "shop_id")
    @NotNull(message = "id不能为空", groups = UpdateShopGroup.class)
    @ApiModelProperty(value = "门店编号id", example = "1")
    private Integer id;

    @Column(name = "shop_name")
    @NotEmpty(message = "门店名称不能为空", groups = {AddShopGroup.class})
    @ApiModelProperty(value = "门店名称", example = "天府一街店")
    private String name;

    @Column(name = "shop_phone")
    @Pattern(regexp = "^1[3|4|5|7|8][0-9]{9}$", message = "请输入正确手机号",
            groups = {AddShopGroup.class,UpdateShopGroup.class})
    @ApiModelProperty(value = "门店手机号", example = "18811110001")
    private String phone;

    @Column(name = "shop_address")
    @ApiModelProperty(value = "门店地址", example = "四川省成都市高新区天府一街")
    private String address;

    @Column(name = "shop_coor")
    @ApiModelProperty(value = "门店坐标", example = "30.65126 104.092612")
    private String coor;

    @Column(name = "shop_desc")
    @ApiModelProperty(value = "门店描述", example = "这里是天府一街店")
    private String desc;

    @Column(name = "shop_onTime")
    @ApiModelProperty(value = "上班时间", example = "09:00:00")
    private Time onTime;

    @Column(name = "shop_offTime")
    @ApiModelProperty(value = "下班时间", example = "17:00:00")
    private Time offTime;

    @Column(name = "shop_status")
    @ApiModelProperty(value = "门店状态：0开门（默认）、1关门", example = "0")
    private Integer status;
}
